package com.hyc.www.service;

import com.hyc.www.exception.DaoException;
import com.hyc.www.model.dto.ServiceResult;
import com.hyc.www.model.po.Order;
import com.hyc.www.model.po.Record;
import com.hyc.www.model.po.Ticket;
import com.hyc.www.service.constants.ServiceMessage;
import com.hyc.www.service.constants.Status;

import java.math.BigInteger;
import java.util.List;

/**
 * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
 * @description 用于提供抢票服务
 * @date 2019-07-17 16:34
 */
public interface TicketService {

    /**
     * 查询符合条件的车票
     *
     * @param ticket 车票的限定条件
     * @param page   结果的页数
     * @return 返回车票信息
     * @name listTicket
     * @notice none
     * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
     * @date 2019-07-17
     */
    ServiceResult listTicket(Ticket ticket, int page);


    /**
     * 抢票
     *
     * @name buyTicket
     * @notice none
     * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
     * @date 2019-07-18
     */
    ServiceResult buyTicket(BigInteger ticketId, BigInteger userId);

    /**
     * 查询某个用户的车票
     *
     * @return 返回车票信息
     * @name listTicketOrder
     * @notice none
     * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
     * @date 2019-07-17
     */
    ServiceResult listTicketOrder(BigInteger userId);


    /**
     * 查询某个用户的车票
     *
     * @param userId
     * @return 返回记录
     * @name listTicketOrder
     * @notice none
     * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
     * @date 2019-07-17
     */
    ServiceResult listTicketRecord(BigInteger userId);

    /**
     * 退票
     *
     * @notice none
     * @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
     * @date 2019-07-17
     */
    ServiceResult cancelOrder(BigInteger orderId);
}
